package com.mall.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mall.annotation.OperationLog;
import com.mall.db.domain.User;
import com.mall.db.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/system/uc")
public class UserController extends BaseController<User>{


    @Resource(name = "userService")
    private UserService us;


    @Override
    @OperationLog(value = "查询会员成员",type =10 )
    public Map<String, Object> find(User user) {
        //实现分页
        PageHelper.startPage(user.getPage(),user.getLimit());
        QueryWrapper<User> qw = new QueryWrapper<>();
        List<User> list = us.list(qw);
        PageInfo<User> page = new PageInfo<>(list,user.getLimit());
        return this.findMap(page.getList(),page.getTotal());

    }
}
